import {observable, action, /*toJS*/} from 'mobx';
import {Toast,Tools,ListView,Modal} from 'weaver-mobile';
import { RouteLayout,Upload,Form } from 'weaver-mobile-page';
import * as API from '../../api/home/wallet';
import {toJS} from 'mobx'

const getLabel = Tools.getLabel;


export default class DetailPageStore {
    @observable loading = false;
    @observable hasRight = '';
    @observable baseRoute = '';

    @observable routeData = new RouteLayout.Store({route:this.baseRoute});

    @observable invoiceDetails = [];


    initData = (value={}) =>{
        this.getInvoiceDetails();

        
    }

    getInvoiceDetails = ()=>{
        
        this.invoiceDetails = {
            imgSrc:'',
            headeData:[
                {title:'价税合计',money:'546.60',key:'0'},
                {title:'不含税金额合计',money:'546.60',key:'1'},
            ],
            bodyData:{
                caption:'发票详情',
                details:[
                    {title:'发票类型',value:'增值税电子发票'},
                    {title:'发票代码',value:'0110019220200'},
                ]
            }
        }
    }
    

    //根据传出来的数据拼接 key - value
    joinObj = (data,k) =>{
        let _obj = {};
        data.map( item =>{
            _obj[item.key] = item[k]
        })
      
        return _obj
    }


    
}